/*
 * @Author: 来自火星的码农 15122322+heyzhi@user.noreply.gitee.com
 * @Date: 2025-10-11 19:40:26
 * @LastEditors: 来自火星的码农 15122322+heyzhi@user.noreply.gitee.com
 * @LastEditTime: 2025-10-30 14:23:20
 * @FilePath: /GateServer/src/mysql/mysqlmgr.h
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#pragma  once
#include "../util/singleton.h"
#include "mysqldao.h"
#include "../entity/user.h"
namespace Yizhi {
    class MysqlMgr:public Singleton<MysqlMgr>
    {
        friend class Singleton<MysqlMgr>;

        public:

        int RegUser(const std::string &username, const std::string &email,const std::string &psw);
        bool ExistUser(std::string username,std::string email);
        int RsetPsw(std::string username,std::string email,std::string psw);
        bool finduserbyemail(const std::string& email);
        bool login(User& user);
        private:
        MysqlMgr()=default;
        MysqlDao m_dao;
    };
}